/*** Eclipse Class Decompiler plugin, copyright (c) 2012 Chao Chen (cnfree2000@hotmail.com) ***/
package com.qihoo.psdk.util;

import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.util.AttributeSet;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.FrameLayout.LayoutParams;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.ImageView.ScaleType;
import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;
import android.widget.TextView;
import com.qihoo.psdk.local.g;

public class QFloatLayout extends FrameLayout {
    Bitmap a;
    g b;
    String c;

    public QFloatLayout(Context paramContext, g paramg, String paramString) {
        super(paramContext);
        this.a = null;
        this.b = null;
        this.c = "";
        this.b = paramg;
        this.c = paramString;
        b(paramContext);
    }

    public QFloatLayout(Context paramContext, AttributeSet paramAttributeSet) {
        this(paramContext, paramAttributeSet, 0);
    }

    public QFloatLayout(Context paramContext, AttributeSet paramAttributeSet, int paramInt) {
        super(paramContext, paramAttributeSet, paramInt);
        this.a = null;
        this.b = null;
        this.c = "";
        b(paramContext);
    }

    private void b(Context paramContext) {
        if (paramContext == null)
            return;
        FrameLayout.LayoutParams localLayoutParams = new FrameLayout.LayoutParams(c.a(paramContext, 140.0F), c.a(
                paramContext, 70.0F), 51);
        setLayoutParams(localLayoutParams);
        setClickable(true);
        addView(a(paramContext));
    }

    public View a(Context paramContext) {
        FrameLayout localFrameLayout = new FrameLayout(paramContext);
        localFrameLayout.setLayoutParams(new FrameLayout.LayoutParams(-1, -1, 17));
        try {
            LinearLayout localLinearLayout = new LinearLayout(paramContext);
            localLinearLayout.setOrientation(0);
            localLinearLayout.setLayoutParams(new FrameLayout.LayoutParams(-1, -1, 17));
            ImageButton localImageButton = new ImageButton(paramContext);
            localImageButton.setClickable(false);
            localImageButton.setBackgroundColor(Color.parseColor("#00000000"));
            LinearLayout.LayoutParams localLayoutParams1 = new LinearLayout.LayoutParams(c.a(paramContext, 70.0F), -1);
            localLayoutParams1.gravity = 3;
            localLayoutParams1.bottomMargin = 0;
            localLayoutParams1.topMargin = 0;
            localLayoutParams1.leftMargin = 0;
            localLayoutParams1.rightMargin = 0;
            localImageButton.setLayoutParams(localLayoutParams1);
            localImageButton.setPadding(0, 0, 0, 0);
            localImageButton.setScaleType(ImageView.ScaleType.FIT_XY);
            PackageManager localPackageManager = paramContext.getPackageManager();
            int i = localPackageManager.getPackageInfo(paramContext.getPackageName(), 0).applicationInfo.icon;
            localImageButton.setImageResource(i);
            localLinearLayout.addView(localImageButton);
            TextView localTextView = new TextView(paramContext);
            LinearLayout.LayoutParams localLayoutParams2 = new LinearLayout.LayoutParams(-1, -1);
            localLayoutParams2.gravity = 17;
            localTextView.setLayoutParams(localLayoutParams2);
            localTextView.setText(this.b.f);
            localTextView.setGravity(19);
            if (-1 == this.b.g)
                localTextView.setTextColor(Color.rgb(255, 255, 255));
            else
                localTextView.setTextColor(Color.rgb(this.b.g, this.b.h, this.b.i));
            localLinearLayout.addView(localTextView);
            localFrameLayout.addView(localLinearLayout);
        } catch (Exception localException) {
            h.a("QFloatLayout", localException);
        } catch (Error localError) {
            h.a("QFloatLayout", localError);
        }
        return localFrameLayout;
    }
}